package com.zhong.scanerdemo.network;

import java.util.List;

import org.apache.http.NameValuePair;

import com.zhong.scanerdemo.interfaces.IHttpRequest;
import com.zhong.scanerdemo.utils.ClientLogUtil;


public class RequestRunnable implements Runnable {
	private final String TAG = "RequestRunnable";
	private List<NameValuePair> nameValuePairs;
	private IHttpRequest iHttpRequest;
	private String url;

	public RequestRunnable(List<NameValuePair> nameValuePairs, IHttpRequest iHttpRequest,
			String url) {
		this.nameValuePairs = nameValuePairs;
		this.iHttpRequest = iHttpRequest;
		this.url = url;
	}
	
	public void run() {
		ClientLogUtil.i(TAG, "run start" );
		String result = new ByPost().request(nameValuePairs, url);
		iHttpRequest.refresh(result);
	}
}
